package com.z8fz.admin.food.dao.impl;

import java.util.List;
import org.springframework.stereotype.Repository;

import com.z8fz.admin.food.dao.FoodDao;
import com.z8fz.admin.food.model.Food;
import com.z8fz.common.BaseDao;
import com.z8fz.common.pager.PageModel;

@Repository
public class FoodDaoImpl extends BaseDao implements FoodDao {
	
	public PageModel selectFoods() {
		return searchpaginated("from Food");
	}

	public void insertFood(Food food) {
		getSession().save(food);
		
	}
	
	public Food selectFoodById(Integer id) {
		return (Food) this.getHibernateTemplate().get(Food.class, id);
	}
}
